
#include "object.h"

#include <typeinfo>
#include <utility>


object::object ( void )
: placeholder_ ( NULL )
{

}


object::object ( const object & other )
: placeholder_ ( other.placeholder_ ? other.placeholder_->clone () : NULL )
{

}


object::~object ( void )
{
	delete this->placeholder_ ;
}


object & object::swap ( object & rhs )
{
	std::swap ( this->placeholder_, rhs.placeholder_ ) ;
	return *this;
}


bool object::empty ( void ) const
{
	return ! this->placeholder_ ;
}


const std::type_info & object::type ( void ) const
{
	return this->placeholder_ ? this->placeholder_->type () : typeid ( void ) ;
}


object & object::operator = ( const object & rhs )
{
	object ( rhs ).swap ( *this ) ;	// safety destruction
	return *this;
}


//bool object::operator == ( const object & rhs ) const
//{
//	this->placeholder_->size () ;
//
////	(this->placeholder_) == (rhs.placeholder_)->
//	return true ;
//}
//
//
//bool object::operator != ( const object & rhs ) const
//{
//	return true ;
//}
//
//
//bool object::operator < ( const object & rhs ) const
//{
//	return true ;
//}
//
//
//
//bool object::operator <= ( const object & rhs ) const
//{
//	return true ;
//}
//
//
//bool object::operator > ( const object & rhs ) const
//{
//	return true ;
//}
//
//
//bool object::operator >= ( const object & rhs ) const
//{
//	return true ;
//}

